<%--                                                                       --%>
<%-- Copyright (c) 2003-2005 BroadVision, Inc.  All rights reserved.       --%>
<%--                                                                       --%>
<%-- This software is copyrighted. Under the copyright laws, this software --%>
<%-- may not be copied, in whole or in part, without prior written consent --%>
<%-- of BroadVision, Inc. or its assignees. This software is provided      --%>
<%-- under the terms of a license between BroadVision and the recipient,   --%>
<%-- and its use is subject to the terms of that license.                  --%>
<%--                                                                       --%>
<%-- This software may be protected by one or more U.S. and International  --%>
<%-- patents.  Certain applications of BroadVision One-To-One software are --%>
<%-- covered by U.S. patent 5,710,887.                                     --%>
<%--                                                                       --%>
<%-- TRADEMARKS: BroadVision and BroadVision One-To-One are registered     --%>
<%-- trademarks of BroadVision, Inc., in the United States and the         --%>
<%-- European Community, and are trademarks of BroadVision, Inc., in other --%>
<%-- countries.  The BroadVision logo, is a trademark of BroadVision,      --%>
<%-- Inc., in the United States and other countries. Additionally, IONA    --%>
<%-- and Orbix are trademarks of IONA Technologies, Ltd.  RSA, MD5, and    --%>
<%-- RC2 are trademarks of RSA Data Security, Inc.                         --%>
<%--                                                                       --%>

<%@ page import =  "java.util.*,
                    java.net.*,
                    com.broadvision.ssp.client.SspInstance"
%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>

<jsp:useBean id="bpProcessInstanceForm" 
             class="com.broadvision.process.tools.action.process.ProcessInstanceForm"
             scope ="session"/>
<% HashMap map= new HashMap();
   String instanceOid = request.getParameter("instanceOid");
   map.put("instanceOid",instanceOid);
   pageContext.setAttribute("pagetabParam",map);
%>
<html:form action="/bp/processInstance.do?action=edit">
<input type="hidden" name="action" value="edit">
<input type="hidden" name="instanceOid" value="<%= instanceOid %>">

    <table class="zoneFive" width="100%" border="0" cellspacing="0" cellpadding="0" summary="<bean:message key="bp.process.processInstance.contentArea" bundle="bp.messages"/>">
      <tr>
        <td valign="top" width="100%">
          <div class="pageTitle"><bean:write name="bpProcessInstanceForm" property="processInstance.customId"/></div>
         <%@include file="/mc/common/pagetab.jsp" %>
          <div class="pageSubtitle">
            <span class="left"><bean:message key="bp.process.processInstance.header"  bundle="bp.messages"/></span>
            <span class="right"><% if (!("view".equals(request.getParameter("action")) ||  bpProcessInstanceForm.getProcessInstance().getState().getIntCode()==2 ||
bpProcessInstanceForm.getProcessInstance().getState().getIntCode()==3)) { %><input type="submit" class="titleButton" value="<bean:message key="button.edit" bundle="bp.messages"/>"><%}%></span>
          </div> 

          <table class="dataTable" border="0" cellspacing="0" cellpadding="0" summary="<bean:message key="bp.process.processInstanceSearch.summary" bundle="bp.messages"/>"  width="100%">        
        
            <tr><td class="errorMessage"><html:errors bundle="bp.messages"/></td></tr>
            <tr>
                <td valign="top" nowrap class="label" width="18%"><bean:message key="bp.process.processInstance.processName" bundle="bp.messages"/></td>                
                <td valign="top" wrap class="labelField" width="40%">
                    <html:link page="/bp/processView.do" paramId="processOid" paramName="bpProcessInstanceForm" paramProperty="processInstance.sspDefinition.sspOid">
<bean:write  name="bpProcessInstanceForm"
                          property="processInstance.sspName"/></html:link> 
                </td>
            </tr>
            <tr>
                <td valign="top" nowrap class="label" width="18%"><bean:message key="bp.process.processInstance.description" bundle="bp.messages"/></td>                
                <td valign="top" wrap class="labelField" width="40%">
                  <bean:write  name="bpProcessInstanceForm"
                    property="processInstance.ssp.description"/>    
                </td>
            </tr>
            <tr>
                <td valign="top" nowrap class="label" width="18%"><bean:message key="bp.process.processInstance.oid" bundle="bp.messages"/></td>                
                <td valign="top" wrap class="labelField" width="40%">
                    <%= bpProcessInstanceForm.getProcessInstance().getOid() %>    
                </td>
            </tr>
            <% long pOid = bpProcessInstanceForm.getProcessInstance().getParentProcessInstanceOid();
               if (pOid > 0) { %>
            <tr>
                <td valign="top" nowrap class="label" width="18%"><bean:message key="bp.process.processInstance.poid" bundle="bp.messages"/></td>                
                <td valign="top" wrap class="labelField" width="40%">
                    <html:link page="<%=\"/bp/processInstance.do?instanceOid=\" + pOid%>"><%= pOid %></html:link>  
                </td>
            </tr>
            <% } %>
            <tr>
                <td valign="top" nowrap class="label" width="18%"><bean:message key="bp.process.processInstance.launchDate" bundle="bp.messages"/></td>                
                <td valign="top" wrap class="labelField" width="40%">
<bean:write name="bpProcessInstanceForm" property="dates.begin" formatKey="format.datetime.long" bundle="mc.messages"/>
                </td>
            </tr>
            <tr>
                <td valign="top" nowrap class="label" width="18%"><bean:message key="bp.process.processInstance.dueDate" bundle="bp.messages"/></td>                
                <td valign="top" wrap class="labelField" width="40%">
<bean:write name="bpProcessInstanceForm" property="dates.due" formatKey="format.datetime.long" bundle="mc.messages"/>
                </td>
            </tr>
            <tr>
                <td valign="top" nowrap class="label" width="18%"><bean:message key="bp.process.processInstance.completionTime" bundle="bp.messages"/></td>                
                <td valign="top" wrap class="labelField" width="40%">
<bean:write name="bpProcessInstanceForm" property="dates.end" formatKey="format.datetime.long" bundle="mc.messages"/>
                </td>
            </tr>
            <tr>
                <td valign="top" nowrap class="label" width="18%"><bean:message key="bp.process.processInstance.manager" bundle="bp.messages"/></td>                
                <td valign="top" wrap class="labelField" width="40%">
                    <bean:write  name="bpProcessInstanceForm" 
                    property="processInstance.sspDefinition.manager"/>
                </td>
            </tr>
            <tr>
                <td valign="top" nowrap class="label" width="18%"><bean:message key="bp.process.processInstance.instanceName" bundle="bp.messages"/></td>
                <td valign="top" nowrap class="labelField" width="40%"> 
                    <bean:write  name="bpProcessInstanceForm" 
                    property="processInstance.customId"/>
                </td>
            </tr>
            <tr>
                <td valign="top" nowrap class="label" width="18%"><bean:message key="bp.process.processInstance.state" bundle="bp.messages"/></td>
                <td valign="top" nowrap class="labelField" width="40%"> 
                    <bean:write  name="bpProcessInstanceForm" 
                    property="state"/>
                </td>
            </tr>
            <tr>
                <td valign="top" nowrap class="label" width="18%"><bean:message key="bp.process.processInstance.processManager" bundle="bp.messages"/></td>
                <td valign="top" nowrap class="labelField" width="40%"> 
                    <bean:write  name="bpProcessInstanceForm" 
                    property="processInstance.manager"/>
                </td>
            </tr>
        </table>
        </td>
      </tr>
    </table>
  </html:form>
